package com.bupt.liutong.admin.core.dao;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.bupt.liutong.admin.core.base.BaseDto;
import com.bupt.liutong.admin.core.base.Ibatis;
import com.bupt.liutong.util.BeanUtils;

public class PopWindowDao {
	private Ibatis ibatis;
	
	@SuppressWarnings("unchecked")
	public List<Map<String, Object>> getListByPage(String sqlMapId,
			BaseDto baseDto) {
		List<?> list = ibatis.queryForPage(sqlMapId, baseDto);
		List<Map<String, Object>> resultList = new ArrayList();
		if (list != null) {
			for (int i = 0; i < list.size(); i++) {
				resultList.add((Map<String, Object>) BeanUtils.copyProperties(list.get(i)));
			}
		}
		return resultList;
	}

	public void setIbatis(Ibatis ibatis) {
		this.ibatis = ibatis;
	}
}
